﻿// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base..conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import Vuex from 'vuex'
import store from './store'
import { AjaxPlugin } from 'vux'
import 'lib-flexible'
import $ from 'jquery'

Vue.use(Vuex)
Vue.use(AjaxPlugin)

//添加fastclick
const FastClick = require('fastclick');
FastClick.attach(document.body);

Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})

router.beforeEach(function (to, from, next) {
  store.commit('updateLoadingStatus', {isLoading: true})
  next()
})

router.afterEach(function (to) {
  store.commit('updateLoadingStatus', {isLoading: false})
})